package com.wsz.matching.service.impl;

import com.wsz.matching.service.MatchingServer;
import com.wsz.matching.utils.MatchingPool;
import com.wsz.pojo.R;
import com.wsz.pojo.dto.MatchingDto;
import org.springframework.stereotype.Service;

@Service
public class MatchingServerImpl implements MatchingServer {
    public final static MatchingPool matching  = new MatchingPool();

    @Override
    public R addPlayer(MatchingDto matchingDto) {
        matching.addPlayer(matchingDto.getUserId(),matchingDto.getRanting(),matchingDto.getBot_id());
        return R.ok();
    }

    @Override
    public R removePlayer(MatchingDto matchingDto) {
        matching.removePlayer(matchingDto.getUserId());
        return R.ok();
    }
}
